package org.imlinker.login;

import java.util.ResourceBundle;

import org.imlinker.gui.LoginWindow;

public class WindowManager {

	public WindowManager(final Login login) {

		java.awt.EventQueue.invokeLater(new Runnable() {
			public void run() {
				loginWindow = new LoginWindow(login);
				loginWindow.setVisible(true);
			}
		});

		bundle = java.util.ResourceBundle.getBundle("org/imlinker/gui/Bundle"); // NOI18N

	}

	public void setStatusByBundle(final String bundleUrl) {

		java.awt.EventQueue.invokeLater(new Runnable() {
			public void run() {
				loginWindow.setStatus(bundle.getString(bundleUrl));
			}
		});
	}

	public void closeLoginWindow() {
		loginWindow.setVisible(false);
		loginWindow.dispose();
	}

	private LoginWindow loginWindow;

	private ResourceBundle bundle;

}
